package onlinecalsys.client.view.gui;


 /****************************************************************/ 
 /*                      SharedAppointment	                            */ 
 /*                                                              */ 
 /****************************************************************/ 
 import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.URL;

import javax.imageio.ImageIO;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.UIManager;
import javax.swing.WindowConstants;
 /** 
  * Summary description for SharedAppointment 
  * 
  */ 
 public class SharedAppointment extends JFrame 
 { 
 	// Variables declaration 
 	private JTextArea jTextAreaSharedAppointment; 
 	private JScrollPane jScrollPane1; 
 	private JPanel contentPane; 
 	// End of variables declaration 
  
  
 	public SharedAppointment() 
 	{ 
 		super(); 
 		initializeComponent(); 
 		// 
 		// TODO: Add any constructor code after initializeComponent call 
 		// 
  
 		
 	// load frame logo
		BufferedImage image = null;
		try {
			URL u = this.getClass().getResource(
			"../../../../");
			File f = new File(u.getPath().replaceAll("bin/", "images/middle1.png"));
			System.out.println(f.getAbsolutePath());
			image = ImageIO.read(f);
			
			
		} catch (IOException e) {
			new Error("failed loading middle1.png");
		} catch (Exception e) {
			new Error("failed loading middle1.png");
		}
		this.setIconImage(image);
 		this.setVisible(true); 
 		this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
 	} 
  
 	/** 
 	 * This method is called from within the constructor to initialize the form. 
 	 * WARNING: Do NOT modify this code. The content of this method is always regenerated 
 	 * by the Windows Form Designer. Otherwise, retrieving design might not work properly. 
 	 * Tip: If you must revise this method, please backup this GUI file for JFrameBuilder 
 	 * to retrieve your design properly in future, before revising this method. 
 	 */ 
 	private void initializeComponent() 
 	{ 
 		jTextAreaSharedAppointment = new JTextArea(); 
 		jScrollPane1 = new JScrollPane(); 
 		contentPane = (JPanel)this.getContentPane(); 
  
 		// 
 		// jTextAreaSharedAppointment 
 		// 
 		jTextAreaSharedAppointment.setEnabled(false); 
 		// 
 		// jScrollPane1 
 		// 
 		jScrollPane1.setViewportView(jTextAreaSharedAppointment); 
 		// 
 		// contentPane 
 		// 
 		contentPane.setLayout(null); 
 		addComponent(contentPane, jScrollPane1, 2,2,469,262); 
 		// 
 		// SharedAppointment 
 		// 
 		this.setTitle("SharedAppointment - extends JFrame"); 
 		this.setLocation(new Point(0, -1)); 
 		this.setSize(new Dimension(487, 300)); 
 		this.setResizable(false); 
 	} 
  
 	/** Add Component Without a Layout Manager (Absolute Positioning) */ 
 	private void addComponent(Container container,Component c,int x,int y,int width,int height) 
 	{ 
 		c.setBounds(x,y,width,height); 
 		container.add(c); 
 	} 
  
 	// 
 	// TODO: Add any method code to meet your needs in the following area 
 	// 
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
   
  
 //============================= Testing ================================// 
 //=                                                                    =// 
 //= The following main method is just for testing this class you built.=// 
 //= After testing,you may simply delete it.                            =// 
 //======================================================================// 
 	public static void main(String[] args) 
 	{ 
 		JFrame.setDefaultLookAndFeelDecorated(true); 
 		JDialog.setDefaultLookAndFeelDecorated(true); 
 		try 
 		{ 
 			UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); 
 		} 
 		catch (Exception ex) 
 		{ 
 			System.out.println("Failed loading L&F: "); 
 			System.out.println(ex); 
 		} 
 		new SharedAppointment(); 
 	} 
 //= End of Testing = 

	public void setText(String appoinments) {
		jTextAreaSharedAppointment.setText(appoinments);
		
	}
  
  
 } 
  
 